package com.servlet;

import com.Dao.BorrowDao;
import com.bean.BorrowBean;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.ArrayList;

@WebServlet(name = "borrowInfoServlet", value = "/borrowInfoServlet")
public class borrowInfoServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");
        HttpSession session=request.getSession();
        BorrowDao borrowDao=new BorrowDao();
        ArrayList<BorrowBean> list = new ArrayList<BorrowBean>();
        list=borrowDao.getList();
        session.setAttribute("list3",list);
        response.sendRedirect("borrow_info.jsp");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
